function parseTableColumns(htmlString) {
  // 正则表达式匹配 <el-table-column> 标签
  const columnRegex = /<el-table-column[^>]*>/gi
  // 用于存储解析后的列数组
  const columns = []

  // 找到所有的 <el-table-column> 标签
  const matches = htmlString.match(columnRegex)

  if (matches) {
    matches.forEach((match) => {
      // 解析每个标签的属性
      const labelMatch = match.match(/label="([^"]*)"/)
      const propMatch = match.match(/prop="([^"]*)"/)
      const alignMatch = match.match(/align="([^"]*)"/)
      const classNameMatch = match.match(/class-name="([^"]*)"/)

      // 构建列对象
      const column = {
        title: labelMatch ? labelMatch[1] : '',
        field: propMatch ? propMatch[1] : '',
        align: alignMatch ? alignMatch[1] : 'left', // 默认对齐方式为左对齐
      }

      // 如果存在 class-name 属性且包含 'small-padding fixed-width'
      if (classNameMatch && classNameMatch[1].includes('small-padding fixed-width')) {
        column.title = column.title
        column.field = 'actions'
        column.align = 'center'
        column.slots = { default: 'actions' }
      }
      else {
        column.title = column.title
      }

      // 将列对象添加到数组
      columns.push(column)
    })
  }

  return columns
}

const elTable = `
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="对象存储主键" align="center" prop="ossId" v-if="false"/>
      <el-table-column label="文件名" align="center" prop="fileName" />
      <el-table-column label="原名" align="center" prop="originalName" />
      <el-table-column label="文件后缀" align="center" prop="fileSuffix" />
      <el-table-column label="文件展示" align="center" prop="url">
        <template slot-scope="scope">
          <el-image
            v-if="previewListResource && checkFileSuffix(scope.row.fileSuffix)"
            style="width: 100px; height: 100px;"
            :src="scope.row.url"
            :preview-src-list="[scope.row.url]"/>
          <span v-text="scope.row.url"
                v-if="!checkFileSuffix(scope.row.fileSuffix) || !previewListResource"/>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180"
                       sortable="custom">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="上传人" align="center" prop="createBy" />
      <el-table-column label="服务商" align="center" prop="service"
                       sortable="custom"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      </el-table-column>
`
console.log(parseTableColumns(elTable))
